<%@page import="hyl.ext.base.MySession"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="hyl.core.db.MyDB,java.io.PrintWriter"%>
<%@ page import="java.util.List,java.util.Map"%>
<%@ page import="com.servlet.*,hyl.core.MyFun"%>
<%
	PrintWriter shuchu = response.getWriter();
	int state = Integer.valueOf(request.getParameter("state"));
	//保存权限
	if(state==2){
		int id = MyFun.str2int(request.getParameter("id"));
		String data = request.getParameter("data");
		MyDB db=My.getDB1();
		String sql = "update sys_rolemanage set manage=? where id=?";
		Object[] param = {data,id};
	    //M.LRole.get(MyFun.str2int(id)).put("manage", data);
	    List<Map<String, Object>> list = M.LRole;
	    for(int i=0;i<list.size();i++){
	    	Map<String,Object> map = list.get(i);
	    	int rid = MyFun.obj2Int(map.get("id"));
	    	if(id==rid){
	    		map.put("manage",data);
	    	}
	    }
		db.executeUpdate(sql, param);
		MySession ss = My.getSession(request,response);
		if((ss.istate&id)==id){
			ss.tag.put("quanxian", data);
		}
		shuchu.print("success");
	}
%>